'use strict';

/**
 * 生成数字
 */
exports.randomInt = function (max) {
  const random = Math.random();
  const num = Math.round(random * (max - 1)) + 1;
  return num;
};

/**
 * 数字生成固定长度字符串
 */
exports.proFixedStringByNumber = function (num, len) {
  let code = num + "";
  let max = len - code.length;
  if (max < 1) {
    return code;
  }
  for (let i = 0; i < max; i++) {
    code = "0" + code;
  }
  return code;
};
